﻿using Pattern23责任链模式.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Pattern23责任链模式.Base
{
    /// <summary>
    /// 抽象的处理器的基类
    /// </summary>
    public abstract class HandlerBase
    {
        /// <summary>
        /// 是否同意
        /// </summary>
        /// <param name="order"></param>
        public abstract void Approve(Order order);

        /// <summary>
        /// 下一个签字人
        /// </summary>
        public HandlerBase NextHandler { get; private set; }

        /// <summary>
        /// 设置下一个签字人
        /// </summary>
        /// <param name="nextHandler"></param>
        public virtual void SetNextHandler(HandlerBase nextHandler)
        {
            NextHandler = nextHandler;
        }
    }
}
